package com.fkdx.common.enums.sys;

import lombok.AllArgsConstructor;
import lombok.Getter;

@Getter
@AllArgsConstructor
public enum ErrCodeEnum {

    //系统枚举
    SUCCESS(0, "成功"),
    SERVER_ERROR(9999, "未知错误"),
    NETWORK_ERROR(9998, "网络错误"),
    PARAM_ERROR(9997, "参数错误"),
    PERM_ERROR(9996, "权限错误"),
    SESSION_EXPIRED(9995, "登录失效"),
    VIDEO_CLOUD_OPER_ERROR(9993, "控制台操作失败"),
    DEVICE_OPER_NOT_SUPPORT(9994, "不支持该设备，目前只支持海康，大华品牌摄像头"),
    POSTCODE_ERROR(9991, "邮箱格式不正确"),
    ACCESS_TOKEN_EXPIRE(403, "accessToken过期"),

    // 其他异常
    DATA_INTEGRITY_VIOLATION(8999, "超出数据库字段的长度"),

    //业务枚举-入库
    B_CARD(140001, "卡号不存在"),
    B_INBOUND_CARD(140001, "入库卡号存在未完成的流程，请检查流程节点完成操作后在进行登记领卡操作"),
    B_INBOUND_CARD_QUERY(140001,"根据卡号未查询到数据"),
    B_INBOUND_CHECKIN(140002, "入库登记领卡异常"),
    B_INBOUND_PRICE(140002, "请配置粮食定价标准【综合办公-化验与定价-粮食定价-发布质检公告】"),
    B_INBOUND_ASSAY_DATA(150001, "化验项数据不能为空"),
    B_INBOUND_ASSAY_DATA_MATCHING(150001, "未匹配到定级等级"),
    B_INBOUND_ASSAY_DATA_PARAM(150001, "请求数据不存在定级化验项"),
    B_INBOUND_ASSAY_GRADING(150001, "化验模板汇中不存在定级化验项"),
    B_INBOUND_ASSAY_OPER(140003, "粮食化验已经操作,无需重复操作,请执行下一个流程磅房称重"),
    B_INBOUND_GRAIN(140005, "粮食数据保存失败"),
    B_INBOUND_ASSAY(140005, "粮食化验数据保存失败"),
    B_INBOUND_ALREADY_ASSAY(140005, "该粮食已经化验过并且定价完成，请勿重复化验"),
    B_INBOUND_PRICING(140005, "核定单价失败"),
    B_INBOUND_INVENTORY_PLAN(140005, "请先到货位卡中维护本次粮食货位卡周期，否则将无法将数据上传到省平台"),

    B_INBOUND_APPROVED_STATUS(140005, "定价拒收状态不能操作,请出库销卡"),

    B_VARIETY(140005, "货位卡中存储的粮食品种与所选品种不同请检查:请确保粮食品种、粮食性质都要保持一致"),

    B_WAREHOUSE(140005, "所选货位卡与合同中的不同请检查"),

    B_INBOUND_PRICING_OPER(140005, "请先操作粮食定价"),

    B_INBOUND_REPEAT_WEIGHT_OPER(140005, "请勿重复称重"),
    B_INBOUND_PROUND(140005, "称重数据报错失败"),
    B_INBOUND_PROUND_OPER(140005, "请先操作磅房称重"),
    B_INBOUND_SETTLEMENT(140004, "入库结算付款未获取到信息"),
    B_INBOUND_SETTLEMENT_OVER(140004, "入库结算付款已经完成，请勿重复操作"),

    B_CANCAL_OVER(140004, "出库销卡已经完成，请勿重复操作"),
    B_INBOUND_CHECKOUT(140003, "入库销卡异常"),
    B_INBOUND_STORAGE_CARD_INVENTORY(140003, "入库粮食库存保存失败"),


    //业务枚举-出库
    B_OUTBOUND_CHECKOUT_OPER(150001, "出库卡号存在未完成的流程，请检查流程节点完成操作后在进行登记领卡操作"),
    B_OUTBOUND_CHECKIN(150001, "出库异常"),
    B_OUTBOUND_CARD(150005, "出库请先操作登记领卡"),
    B_OUTBOUND_INVENTORY_PLAN(140005, "请先填写粮食库存周期，否则无法上传到省平台"),
    B_OUTBOUND_ROUGHT(140005, "请先称毛重"),
    B_OUTBOUND_CARD_OPER(150005, "你已经操作过磅房称重，请到财务结算中操作"),
    B_OUTBOUND_PROUND_OPER(140005, "请先操作磅房称重!!!"),
    B_OUTBOUND_SETTLEMENT_OPER(140005, "已经结算完成!!!"),
    B_OUTBOUND_PROUND(140005, "出库称重数据报错失败"),
    B_OUTBOUND_SETTLEMENT(140004, "结算付款异常"),
    B_OUTBOUND_CHECKOUT(150002, "出库销卡异常"),
    B_OUTBOUND_STORAGE_CARD_INVENTORY(140003, "出库粮食库存保存失败"),
    B_OUTBOUND_VOUCHER(140002, "出库单号异常!"),

    //药剂管理
    M_MEDICAMENT_OUT(160001,"药品库存不足"),

    //倒仓
    R_LOW_STOCK(17001, "倒库出库库存不足"),

    // ------- 硬件设备操作 ---------------
    DEVICE_CONFIG_ERROR(1000, "设备配置错误"),
    DEVICE_CONNECT_ERROR(1001, "设备连接错误"),
    DEVICE_WRITE_ERROR(1002, "设备写入错误"),
    DEVICE_READ_ERROR(1003, "设备读取错误"),

    PRICING_CONFIG_ERROR(1000, "粮食品种等级价格已存在，请勿重复添加"),

    ;

    /**
     * 错误码
     */
    private Integer errCode;

    /**
     * 错误信息
     */
    private String errMsg;

    public void setErrMsg(String errMsg) {
        this.errMsg = errMsg;
    }
}
